package com.vip8.recorder.service.db.model;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * device_info
 * @author 
 */
@Data
public class DeviceInfo implements Serializable {
    private Long id;

    private Date gmtCreate;

    private Date gmtModified;

    /**
     * 设备id
     */
    private String deviceId;

    /**
     * 最近录制时间
     */
    private Date lastRecord;

    /**
     * 最近定位点
     */
    private Object lastPoint;

    /**
     * 最后定位地址
     */
    private String lastAddress;

    /**
     * 设备状态
     */
    private Byte onlineStatus;

    private String appVersion;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DeviceInfo other = (DeviceInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getLastRecord() == null ? other.getLastRecord() == null : this.getLastRecord().equals(other.getLastRecord()))
            && (this.getLastPoint() == null ? other.getLastPoint() == null : this.getLastPoint().equals(other.getLastPoint()))
            && (this.getLastAddress() == null ? other.getLastAddress() == null : this.getLastAddress().equals(other.getLastAddress()))
            && (this.getOnlineStatus() == null ? other.getOnlineStatus() == null : this.getOnlineStatus().equals(other.getOnlineStatus()))
            && (this.getAppVersion() == null ? other.getAppVersion() == null : this.getAppVersion().equals(other.getAppVersion()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getLastRecord() == null) ? 0 : getLastRecord().hashCode());
        result = prime * result + ((getLastPoint() == null) ? 0 : getLastPoint().hashCode());
        result = prime * result + ((getLastAddress() == null) ? 0 : getLastAddress().hashCode());
        result = prime * result + ((getOnlineStatus() == null) ? 0 : getOnlineStatus().hashCode());
        result = prime * result + ((getAppVersion() == null) ? 0 : getAppVersion().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", lastRecord=").append(lastRecord);
        sb.append(", lastPoint=").append(lastPoint);
        sb.append(", lastAddress=").append(lastAddress);
        sb.append(", onlineStatus=").append(onlineStatus);
        sb.append(", appVersion=").append(appVersion);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}